import type { itemModel, serviceModel } from '@/api/model/goodsModel';
import type { userResult } from '@/api/model/userModel';
import { request } from '@/utils/request';

const Api = {
  Users: '/api/admin/getUsers',
  AddItem: '/api/admin/addItem',
  AddService: '/api/admin/addService',
};

export function getUsers() {
  return request.get<userResult>({
    url: Api.Users,
  });
}

export function addItem(item: itemModel) {
  request.post<boolean>({
    url: Api.AddItem,
    data: item,
  });
}

export function addService(service: serviceModel) {
  request.post<boolean>({
    url: Api.AddService,
    data: service,
  });
}
